try:
    #file1=open("D:\\xba.txt","rt")      #只读文件
    #file1 = open("D:\\xba.txt", "wt")   #创建或打开文件，允许写入数据
    file1 = open("D:\\xba.txt", "at")   #追加打开一个文件文本
    file1.write("轩博遨")
    file1.write("\n19岁")


    file1.close()
except Exception as err:
    print("文件错误")